package org.jeecg.modules.yusuan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.yusuan.entity.CaiwuBiaozhun;
import org.jeecg.modules.yusuan.entity.CaiwuLiuyong;

import java.util.List;
import java.util.Map;

/**
 * @Description: caiwu_yusuan
 * @Author: jeecg-boot
 * @Date:   2020-06-15
 * @Version: V1.0
 */
public interface CaiwuLiuyongMapper extends BaseMapper<CaiwuLiuyong> {

    List<CaiwuLiuyong> listData(@Param("deptId") String deptId,@Param("deptCode")String deptCode, @Param("categoryPid") String categoryPid);

    List<CaiwuLiuyong> zhibiaolistData(@Param("deptId") String deptId,@Param("deptCode")String deptCode, @Param("categoryPid") String categoryPid);

    @Select("select xiafashu shenheshu,category_id as categoryId,(xiafashu - shenheshu) as jz from caiwu_liuyong y,sys_category c where c.id = y.category_id and c.sys_org_code = 'A01' and dept_id = #{deptId}")
    List<Map> shenheshu(@Param("deptId") String deptId);
}
